import NftEggsNFT from "../contracts/NftEggsNFT.cdc"

// This script reads metadata about an NFT in a user's collection
pub fun main(account: Address, id: UInt64): UInt64 {

    // 获取对拥有者账户公共功能的引用
    let collectionRef = getAccount(account)
        .getCapability(/public/NFTCollection)
        .borrow<&{NftEggsNFT.NftEggsNFTCollectionPublic}>()
        ?? panic("Could not borrow capability from public collection")

    // 获取对指定NFT的引用
    let nft = collectionRef.borrowNFT(id: id)

    return nft.id
}